<?php



namespace App\Http\Requests\ApiV2;

use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;

class SolutionRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'content' => 'required',


        ];
    }

    public function messages()
    {
        return [
            'content.required' => __('请输入答案的内容'),
        ];
    }

    public function filldata()
    {
        return [
            'user_id'=>Auth::id(),
            'content' => (string)$this->input('content', ''),
            'attaches' => (array)$this->input('attaches', []),
            'recommends' => (array)$this->input('recommends', []),
        ];
    }
}
